package com.chagee.store.operation.server.service.third;

import com.chagee.base.utils.SoaResponse;
import com.chagee.base.utils.SoaUtil;
import com.chagee.channel.api.service.IOssServiceApi;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @Author : hk
 * @Date : 2024/10/24
 */

@Service
@RequiredArgsConstructor
public class OssThirdService {

	@Resource
	private IOssServiceApi ossServiceApi;

	public String upload(byte[] pic, String fileName) {
		SoaResponse<String, Void> response = ossServiceApi.upload(pic, fileName);
		return SoaUtil.unpack(response);
	}

}
